package javacafe.action.factory;

import javacafe.action.Action;
import javacafe.action.ActionFactory;
import javacafe.action.vote.VoteAddAction;
import javacafe.action.vote.VoteAddFormAction;
import javacafe.action.vote.VoteDeleteAction;
import javacafe.action.vote.VoteDetailAction;
import javacafe.action.vote.VoteFormAction;
import javacafe.action.vote.VoteUpdateAction;
import javacafe.action.vote.VoteUpdateCountAction;
import javacafe.action.vote.VoteUpdateFormAction;


public class VoteActionFactory implements ActionFactory {
	private static VoteActionFactory factory;
	
	public static VoteActionFactory getInstance(){
		if(factory==null){
			factory=new VoteActionFactory();
		}
		return factory;
	}

	public Action getAction(String command){
		Action action=null;
		if(command.equalsIgnoreCase("votelistform")){
			action=new VoteFormAction();
			
		}else if(command.equalsIgnoreCase("detailvote")){
			action=new VoteDetailAction();		
			
		}else if(command.equalsIgnoreCase("updatevotecount")){
			action=new VoteUpdateCountAction();		
		
		}else if(command.equalsIgnoreCase("addvoteform")){
			action=new VoteAddFormAction();		
			
		}else if(command.equalsIgnoreCase("addvote")){
			action=new VoteAddAction();		
		
		}else if(command.equalsIgnoreCase("updatevoteform")){
			action=new VoteUpdateFormAction();
			
		}else if(command.equalsIgnoreCase("updatevote")){
			action=new VoteUpdateAction();		
			
		}else if(command.equalsIgnoreCase("deletevote")){
			action=new VoteDeleteAction();		
		}
		return action;
	}//
}
